home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-02-26 | 924 b | 32 lines | [TEXT/KAHL] |
- /* This is the same code as in the think C libraries, it's just
- shorter this way so that you don't have to include all the MacTraps
- routines if you don't want to. (just to get this few lines of code
- would be a MAJOR waste!)
-
- I urge you to conserve memory and NOT to just include files when
- you really don't have to.
-
- */
-
- int HLock(void);
- int HUnlock(void);
-
- HLock(){
- asm{
- movea.l (A7)+,A1 /* pull return address off stack put it in A1 */
- movea.l (A7)+,A0 /* pull "handle" and put in into A0 */
- HLock
- move.l A1,-(A7) /* put the return address back so we can return */
- move.w d0,0x0220 /* put any error into global "MemErr" */
- }
- }
-
- HUnlock(){
- asm{
- movea.l (A7)+,A1 /* pull return address off stack put it in A1 */
- movea.l (A7)+,A0 /* pull "handle" and put in into A0 */
- HUnlock
- move.l A1,-(A7) /* put the return address back so we can return */
- move.w d0,0x0220 /* put any error into global "MemErr" */
- }
- }